#!/bin/bash -e

# tiff-to-pdf.sh
# 
# Convert all TIFF images to PDF files with the same name under the current
# directory, recursively
# 
# Depends: libtiff-tools (provides /usr/bin/tiff2pdf)

for tiffpath in $(find . -name '*.tif'); do
	TIFF_PATH=${tiffpath:0:$((${#tiffpath} - 4))}
	tiff2pdf "$TIFF_PATH.tif" -o "$TIFF_PATH.pdf"
done
